Create an example to document egress policies - #94
Merged
Merged
Conversation
Run the same HTTP request through the container shell, Worker shell, and Worker JavaScript backends. Apply one EGRESS_MODE policy to all three and return comparable status, MIME type, or error results. Include blocked, direct, and allowlisted gateway modes with focused tests and local run instructions. Pin the container runtime to Debian bookworm so package signature verification and the FUSE 2 library remain compatible.
|
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Run the same HTTP request through the container shell, Worker shell,
and Worker JavaScript backends. Apply one EGRESS_MODE policy to all
three and return comparable status, MIME type, or error results.
Include blocked, direct, and allowlisted gateway modes with focused
tests and local run instructions. Pin the container runtime to Debian
bookworm so package signature verification and the FUSE 2 library
remain compatible.
EGRESS_MODEapplies the same egress policy to every backend.EGRESS_MODEnone{ mode: "none" }all{ mode: "direct" }custom{ mode: "http-gateway" }https://example.com. Other origins receive403.Then run the server:
Then send a request:
curl -X POST 'http://127.0.0.1:8787/fetch?url=https%3A%2F%2Fexample.com'The endpoint returns the status code and MIME type from each backend, or an error when no response was available:
{ "mode": "all", "url": "https://example.com/", "container": { "status": 200, "mimeType": "text/html" }, "worker-shell": { "status": 200, "mimeType": "text/html" }, "worker-javascript": { "status": 200, "mimeType": "text/html" } }